/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package validadores;


import javax.faces.validator.*;
import javax.faces.application.*;
import javax.faces.component.*;
import javax.faces.context.*;
import java.util.regex.*; 

/**
 *
 * @author Windows
 * http://www.roseindia.net/jsf/validator.shtml
 */
public class PasswordConfirm implements Validator{
    public PasswordConfirm(){}

    @Override
    public void validate(
            FacesContext facesContext, UIComponent uIComponent, Object object
            ) throws ValidatorException
    {
        String password = (String)object;
        
        if (password.length() <3) {
            FacesMessage message = new FacesMessage();
            message.setSummary("Password muy corto");
            throw new ValidatorException(message);
        }
    }
}